<?php
namespace Tensent\SentAdmin;

use think\Route;
use think\Service;
use think\Console;
use Tensent\SentAdmin\Support\Context;
use Tensent\SentAdmin\Support\Translator;

class ServiceProvider extends Service {
    /**
     * @var array
     */
    protected $commands = [];

    public function register() {
        // $this->loadAdminAuthConfig();
        $this->registerRouteMiddleware();
        $this->registerServices();
        $this->registerExtensions();

        $this->commands($this->commands);
    }

    public function boot(Route $route) {
        
    }

    public function registerServices(){
        $this->app->bind('admin.context', Context::class);
        $this->app->bind('admin.translator', Translator::class);
    }

    public function registerExtensions(){
        // Admin::extension()->register();
    }
    
    /**
     * 路由中间件注册.
     *
     * @return void
     */
    protected function registerRouteMiddleware(){
        $this->loadRoutesFrom(__DIR__ . '/Route/route.php');
    }
}
